<template>
	<view class="list">
		<view class="fixbg" :style="{'background-image':'url('+playlist.coverImgUrl+')'   }"></view>
		<!-- 	<musichead title="歌单" color="white" :icon="true"></muscihead> -->
		<musichead title="歌单" color="white" :icon="true"></musichead>

		<view class="container" v-show="!isloding">
			<scroll-view scroll-y="true" >
				<view class="list-head">
					<view class="list-head-img">
						<image :src="playlist.coverImgUrl" mode=""></image>
						<text class="iconfont icon-arrow-right-filling">{{playlist.playCount}}</text>
						<text></text>
					</view>
					<view class="list-head-text">
						<view>
							{{playlist.name}}
						</view>
						<view>
							<image :src="playlist.creator.avatarUrl" mode=""></image>{{playlist.creator.nickname}}
						</view>
						<view>{{playlist.description}}</view>
					</view>
				</view>
				<!-- #ifdef MP-WEIXIN -->
					<button open-type="share" class="list-share">
						<text class="iconfont icon-share"></text>分享给微信好友
					</button>
				<!-- #endif -->
		
				
				<view class="list-music">
					<view class="list-music-head">
						<text class="iconfont icon-play"></text>
						<text>播放全部</text>
						<text>(共{{playlist.trackCount}}首)</text>
					</view>
				<!-- 	<view class="list-music-item">
						<view class="list-music-item-left">
							1
						</view>
						<view class="list-music-item-center">
							<view>与我无关</view>
							<view>
								<image src="#" mode=""></image>
								<image src="#" mode=""></image>
								<text>阿冗-与我无关</text>
							</view>
						</view>
						<view class="list-music-item-right">
							<text class="iconfont icon-bofang"></text>
						</view>
					</view> -->
					
					<view class="list-music-item" v-for="(item,index) in playlist.tracks " :key="index" @tap="handletodetail(item.id)">
						<view class="list-music-item-left">
							{{index+1}}
						</view>
						<view class="list-music-item-center">
							<view>{{item.name}}</view>
							<view>
						<!-- 		<image src="#" mode=""></image>
								<image src="#" mode=""></image> -->
								<text>{{item.ar[0].name}}-{{item.name}}</text>
							</view>
						</view>
						<view class="list-music-item-right">
							<text class="iconfont icon-bofang"></text>
						</view>
					</view>
				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	import musichead from "../../components/musichead/musichead.vue"
	import {List} from "../../common/api.js"
	export default {
		data() {
			return {
				playlist:{},
				isloding:'ture'
			}
		},
		components: {
			musichead
		},
		methods: {
			handletodetail(id){
				uni.navigateTo({
					url:"../detail/detail?id="+id,
					
				})
			}
		},
		onLoad(o) {
			List(o.listid).then(res=>{
				// console.log(res);
					this.playlist =res[1].data.playlist
					console.log(this.playlist);
					this.isloding = false
			})
		}
	}
</script>

<style scoped>
	.list{}
	.list-head{display: flex;margin: 30rpx;}
	.list-head-img{width:264rpx;height:264rpx;border-radius: 30rpx;overflow: hidden;position: relative;margin-right: 42rpx;}
	.list-head-img image{height: 100%;width: 100%;}
	.list-head-img text{position: absolute;font-size: 26rpx;top: 8rpx;right: 8rpx;color: white;}
	.list-head-text{flex: 1;color: #f0f2f7;} 
	.list-head-text view:nth-child(1){ color: white;font-size: 34rpx;}
	.list-head-text view:nth-child(2){ display: flex;margin: 20rpx 0;font-size: 24rpx;align-items: center;}
	.list-head-text view:nth-child(2) image{width: 54rpx;height: 54rpx;border-radius: 50%;margin-right: 14rpx;}
	.list-head-text view:nth-child(3){line-height: 34rpx;font-size: 22rpx;}
	.list-share{width: 330rpx;height: 74rpx;margin: 0 auto;background: rgba(0,0,0,0.4);border-radius: 38rpx;color: white;text-align: center;line-height: 74rpx;font-size: 28rpx;}
	.list-share text{margin-right: 16rpx;font-size: 28rpx;}
	
	.list-music{background: white;margin-top: 40rpx;border-radius: 50rpx;overflow: hidden;}
	.list-music-head{height: 50rpx; margin: 30rpx 0 70rpx 22rpx;}
	.list-music-head text:nth-child(1){height: 70rpx;font-size: 50rpx;}
	.list-music-head text:nth-child(2){font-size: 30rpx;margin-left: 26rpx;}
	.list-music-head text:nth-child(3){font-size: 26rpx;color: #b2b2b2;margin-left: 10rpx;	}
	.list-music-item{display: flex; margin: 0rpx 32rpx 66rpx 46rpx; align-items: center;color: #959595;}
	.list-music-item-left{width: 58rpx;font-size: 30rpx;line-height: 30rpx;}
	.list-music-item-center{flex: 1;}
	.list-music-item-center view:nth-child(1){font-size: 28rpx;color: black;width: 70vw;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}
	.list-music-item-center view:nth-child(2){font-size: 20rpx;align-items: center;width: 70vw;white-space: nowrap;overflow: hidden; flex-shrink: 0;}
	.list-music-item-center view:nth-child(2) image{width: 32rpx;height: 20rpx;margin-right: 10rpx;}
	.list-music-item-right{font-size: 50rpx; color: #c7c7c7;}
</style>
